<?php
use yii\helpers\Html;
use yii\bootstrap\ActiveForm;

/* @var $this yii\web\View */
/* @var $form yii\bootstrap\ActiveForm */
/* @var $model \common\models\LoginForm */

$this->title = '登录';

$this->registerCss("
    body{
       padding:0px;
       margin:0px;
       background:url(/img/login-bg.jpg) no-repeat center;
       background-size:cover;
       position: relative
    }
    input[type=text], input[type=password] {
        background: rgba(255, 255, 255, 0);
        border: 1px solid #fff;
        color:#fff;
    }
    .btn-myprimary {
        color: #333;
        background-color: #fff;
    }
    .mui-bar {
        background: rgba(255, 255, 255, 0);
    }
    #myheader a{color:#fff}
");

$fieldOptions1 = [
    'options' => ['class' => 'form-group has-feedback'],
    'inputTemplate' => "{input}<span class='glyphicon glyphicon-envelope form-control-feedback'></span>"
];

$fieldOptions2 = [
    'options' => ['class' => 'form-group has-feedback'],
    'inputTemplate' => "{input}<span class='glyphicon glyphicon-lock form-control-feedback'></span>"
];
?>
<style type="text/css">
    .login-page, .register-page {background: #00a65a;}
</style>
<div class="login-box">
    <header id="myheader" class="mui-bar mui-bar-nav">
        <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
        <a href="#menu" class="mui-icon mui-action-menu mui-icon-bars mui-pull-right"></a>
        <h1 class="mui-title"></h1>
    </header>
    <!-- /.login-logo -->
    <div class="login-box-body" style="width:90%;position: fixed;top:50%;left:50%;transform: translate(-50%,-50%);padding: 30px 15px 15px 15px;background: rgba(255, 255, 255, 0); ">

        <?php $form = ActiveForm::begin(['id' => 'login-form', 'enableClientValidation' => false]); ?>

        <?= $form
            ->field($model, 'username', $fieldOptions1)
            ->label(false)
            ->textInput(['placeholder' => $model->getAttributeLabel('username')]) ?>

        <?= $form
            ->field($model, 'password', $fieldOptions2)
            ->label(false)
            ->passwordInput(['placeholder' => $model->getAttributeLabel('password')]) ?>

        <div class="row">
            <div class="col-xs-8">
                <?= $form->field($model, 'rememberMe')->checkbox() ?>
            </div>
            <!-- /.col -->
            <div class="col-xs-4">
                <?= Html::submitButton('登 录', ['class' => 'btn btn-myprimary btn-block btn-flat', 'name' => 'login-button']) ?>
            </div>
            <!-- /.col -->
        </div>


        <?php ActiveForm::end(); ?>
        <p style="text-align: center;margin-top: 15px;"><a href="/touch/default/signup" style="color:#fff">没有账号，去注册</a></p>
    </div>
    <!-- /.login-box-body -->
</div><!-- /.login-box -->
